package myweka;

import weka.core.*;

import java.util.*;
import mymath.*;
import myio.*;

public class Arffsampler {

	/**
	 * @param args
	 */
	public static void main(String[] args) {


		Instances sampleddata = wekautilities.readDataFromFile("/home/jaeger/B/Teaching/DAT7-8/DWML10/Resources/ensemble-header.arff");
		
		Instance nextinst;
		double x,y;
		
		for (int i=0;i<1000;i++){
			nextinst = new Instance(3);
			
			x=Math.random();
			y=Math.random();
			
			nextinst.setDataset(sampleddata);
			nextinst.setValue(0,x);
			nextinst.setValue(1,y);
			if (y>4.5*Math.pow(x,2)-4.5*Math.pow(x,3)+0.3*Math.sin(10*x))
				nextinst.setValue(2,"+");
			else
				nextinst.setValue(2,"-");
			sampleddata.add(nextinst);
		}
		wekautilities.saveDataToFile(sampleddata,"/home/jaeger/B/Teaching/DAT7-8/DWML10/Resources/ensemble.arff");	
	}

}
